#pragma onec
#include <iostream>
#include <deque>
using namespace std;

namespace bit
{
    template<class T, class Con = deque<T>>
    class queue
    {
    public:
        queue():_c() {}
        void push(const T& x);
        void pop();
        T& back();
        const T& back()const;
        T& front();
        const T& front()const;
        size_t size()const;
        bool empty()const;
    private:
        Con _c;
    };

    template<class T, class Con>
    void queue<T,Con>::push(const T& x)
    {
        _c.push_back(x);
    }

    template<class T, class Con>
    void queue<T,Con>::pop()
    {
        _c.pop_front();
    }

    template<class T, class Con>
    T& queue<T,Con>::back()
    {
        return _c.back();
    }

    template<class T, class Con>
    const T& queue<T,Con>::back() const
    {
        return _c.back();
    }

    template<class T, class Con>
    T& queue<T,Con>::front()
    {
        return _c.front();
    }

    template<class T, class Con>
    const T& queue<T,Con>::front() const
    {
        return _c.front();
    }

    template<class T, class Con>
    size_t queue<T,Con>::size() const
    {
        return _c.size();
    }

    template<class T, class Con>
    bool queue<T,Con>::empty() const
    {
        return _c.empty();
    }

};